import { ajaxService } from '@/utils/request';

const env = import.meta.env;
// let baseURL = env.VITE_API_BASE_URL;
let baseURL = env.VITE_INVENTORY_URL;

// 获取仓库列表
export function GetWarehouseAll(params: any) {
  return ajaxService({
    url: '/warehouse/getAll',
    method: 'get',
    baseURL,
    params,
  });
}

// 新增仓库/库区
export function postWarehouse(data: any) {
  return ajaxService({
    url: '/warehouse/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 编辑仓库/库区
export function putWarehouse(data: any) {
  return ajaxService({
    url: '/warehouse/put',
    method: 'put',
    baseURL,
    data,
  });
}

// 删除物料/产品分类
export function delWarehouse(params: any) {
  return ajaxService({
    url: '/warehouse/detlete',
    method: 'delete',
    baseURL,
    params,
  });
}

// 查询仓库类型
export function getWarehouseType(params: any) {
  return ajaxService({
    url: '/warehouse/material/type',
    method: 'get',
    baseURL,
    params,
  });
}

// 删除物料/产品分类
export function postWarehouseType(data: any) {
  return ajaxService({
    url: '/warehouse/material/type',
    method: 'post',
    baseURL,
    data,
  });
}

// 删除物料/产品分类
export function delWarehouseType(params: any) {
  return ajaxService({
    url: '/warehouse/material/type',
    method: 'delete',
    baseURL,
    params,
  });
}
